<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
</head>
<body>
<br/>#标签: <br/>
<span th:id="${user.id}">th:id</span><br/>
<span th:text="${html}">th:text</span><br/>
<span th:utext="${html}">th:utext</span><br/>
<input th:value="${user.name}"/><br/>
<div th:with="isEven=${user.id}%2==0"></div>
<div th:with="isEven=${user.id}%2!=0"></div>

<br/>#字符串: <br/>
<span th:text="'user.name: ' + ${user.name}"></span><br/>
<span th:text="|user.name: ${user.name}|"></span><br/>

<br/>#国际化: <br/>
<span th:text="#{country.name}"></span><br/>

<br/>#格式化: <br/>
<span th:text="${#numbers.formatDecimal(user.salary, 1, 2)}"></span><br/>
<span th:text="${#calendars.format(user.birthday,'yyyy-MM-dd')}"></span><br/>

<br/>#链接: <br/>
<a th:href="@{/user/query(id=${user.id})}">链接:href</a><br/>

<br/>#对象: <br/>
<div th:object="${user}">
    <span th:text="*{id}"></span>
    <span th:text="*{name}"></span>
</div>

<br/>#if<br/>
<a th:if="${user == null}">if (false)</a>
<a th:if="${user != null}">if (true)</a>
<a th:unless="${user == null}">unless (false)</a>
<a th:unless="${user != null}">unless (true) </a>

<br/>#foreach<br/>
<table border="1px">
    <tbody>
    <tr th:each="user:${users}">
        <td th:text="${user.id}"></td>
        <td th:text="${user.name}"></td>
    </tr>
    </tbody>
</table>
</body>
</html>